home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 201-220 / scopedisk202 / bbbbs2 / rexxdoors / one_armed_bandit.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  7KB  |  247 lines

  1. /***************************************/
  2. /* Bandit.rexx  Slot Machine Simulator */
  3. /* By: James M. Cates III Oct. 8 1990  */
  4. /* Arexx V1.10 By: William Hawes       */
  5. /* Original                            */
  6. /* Game Bye: M. Soucy and M. Fox.      */
  7. /* I found the code heavily 'munged'   */
  8. /* So, I did this. It works.           */
  9. /***************************************/
  10.  
  11. CR='0D'x
  12. OPTIONS RESULTS
  13. SIGNAL ON BREAK_C
  14. SIGNAL ON BREAK_E
  15.  
  16. ARG name purse flag .
  17. IF flag>0 THEN
  18.   DO
  19.     dollarsign=''
  20.     playstuff='TIME SECONDS'
  21.   END
  22. ELSE
  23.   DO
  24.     dollarsign='$'
  25.     playstuff='CASH'
  26.   END
  27.  
  28. /**********************************************************************/
  29. /*                  ANSI.rexx                                         */
  30. /*                  Simple ANSI color escape function assignments     */
  31. /*--------------------------------------------------------------------*/
  32. /*                  James M. Cates Sept. 24 1990                      */
  33. /**********************************************************************/
  34.  
  35. red   = ""       /****************************************/
  36. black = ""       /* These just make life easier when you */
  37. white = ""       /* want some color output.              */
  38. rev   = ""        /****************************************/
  39. def   = ""
  40. whred = ""
  41. whblk = ""
  42. ital  = ""
  43. under = ""
  44.  
  45.  
  46. say ' 'CR
  47. say ' 'CR
  48. if purse>0 then
  49. say '                     Welcome back to the Casino!'CR
  50. else
  51. say '                       Welcome to the Casino!'CR
  52. say ' 'CR
  53. say rev'***********************************************************************'CR
  54. say '*   __       ___    _   __        __  _    __    _        _  ___ ___  *'CR
  55. say '*  /  \ |\ | |_    /_\ |__| |\/| |_  | \  |__\  /_\ |\ | | \  |   |   *'CR
  56. say '*  \__/ | \| |__  /   \|  \ |  | |__ |_/  |__/ /   \| \| |_/ _|_  |   *'CR
  57. say '*                                                                     *'CR
  58. say '*   Revision:  Version 1.0       1990 By: James M. Cates III          *'CR
  59. say '*   Original:  Version 0.81      1989 By: M.Soucy and M.Fox           *'CR
  60. say '*                                                                     *'CR
  61. say '***********************************************************************'def||CR
  62. say ' 'CR
  63. say ' 'CR
  64. if purse>0 then call name
  65. say 'Do you need Instructions 'red'('def'Y'red'/'def'N'red')'def' ?'CR
  66. arg
  67. pull ans
  68. do i = 1 to 100
  69. if ans = 'Y' then call inst
  70. else call name
  71. do i = 1 to 100
  72.  
  73. inst:
  74. say ' 'CR
  75. say ital'C''mon now, this is a simple game. You just follow my prompts.'CR
  76. say 'I''ll do all the real work, all you really have to do is place your bet.'CR
  77. say ' 'CR
  78. say 'The symbols for each slot are a bit funny, they are only symb-'CR
  79. say 'bolic, so don''t worry. I did not feel like doing ascii represen-'CR
  80. say 'ations of FRUIT...'def||CR
  81. call play
  82.  
  83. play:
  84. say ' 'CR
  85. say 'Do you want to play 'red'('def'Y'red'/'def'N'red')'def' ?'CR
  86. arg
  87. pull ans
  88. if ans = 'Y' then call name
  89. if ans = 'N' then call death
  90. do i = 1 to 100
  91.  
  92. name:
  93. if purse <10 then purse = 100
  94. bet = 0
  95. Tl = 0
  96. Dl = 0
  97. call Pull
  98.  
  99. Pull:
  100. say ' 'CR
  101. if purse = 0 then call rating
  102. else
  103. say "Purse =" dollarsign||red|| purse || def" Your bet please "red":"def||CR
  104. pull Bet
  105. if Bet > purse then
  106.  do
  107. say ' 'CR
  108. say "Sorry "red||name||def" you can't bet over" dollarsign||red||purse||def||CR
  109. do i = 1 to 100
  110.  end
  111. call Pull
  112.  end
  113. else
  114.  if Bet = 0 | Bet < 0 then call whatthehell
  115. else
  116.  if Bet = '' | Bet = ' ' then call Pull
  117. else
  118. say
  119. say ital'Bet taken...'def||CR
  120. call slots
  121.  
  122. slots:
  123. say ital'Pulling lever for 'under'BIG' playstuff'!'def||CR
  124. call roll
  125. call roll
  126.  
  127. roll:
  128. slot1 = RANDOM(1,6,Time('s'))
  129. slot2 = RANDOM(1,6,Time('s'))
  130. slot3 = RANDOM(1,6,Time('s'))
  131. call stakes
  132.  
  133. stakes:
  134. if slot1 = 1 then slot1 = '@'
  135. if slot1 = 2 then slot1 = '?'
  136. if slot1 = 3 then slot1 = '&'
  137. if slot1 = 4 then slot1 = '^'
  138. if slot1 = 5 then slot1 = '_'
  139. if slot1 = 6 then slot1 = '7'
  140. if slot2 = 1 then slot2 = '@'
  141. if slot2 = 2 then slot2 = '?'
  142. if slot2 = 3 then slot2 = '&'
  143. if slot2 = 4 then slot2 = '^'
  144. if slot2 = 5 then slot2 = '_'
  145. if slot2 = 6 then slot2 = '7'
  146. if slot3 = 1 then slot3 = '@'
  147. if slot3 = 2 then slot3 = '?'
  148. if slot3 = 3 then slot3 = '&'
  149. if slot3 = 4 then slot3 = '^'
  150. if slot3 = 5 then slot3 = '_'
  151. if slot3 = 6 then slot3 = '7'
  152. call output
  153.  
  154. output:
  155. say ' 'CR
  156. say '      <'red slot1 def'>      <'red slot2 def'>      <'red slot3 def'>'CR
  157. call compare
  158.  
  159. compare:
  160. if slot1 = slot2 & slot1 ~= slot3 then call winner1
  161.  else
  162. if slot2 = slot3 & slot2 ~= slot1 then call winner1
  163.  else
  164. if slot1 = slot2 & slot1 = slot3 then call winner2
  165.  else purse = (purse - bet)
  166. call Pull
  167.  
  168. winner1:
  169. say whred'You won double your bet!'def||CR
  170. purse = purse + (bet * 2)
  171. call PDL
  172. call Pull
  173.  
  174. winner2:
  175. say whred'You won TRIPLE your bet!'def||CR
  176. purse = purse + (bet * 3)
  177. call PTL
  178. call Pull
  179.  
  180. whatthehell:
  181. say 'Do you want to continue 'red'('def'Y'red'/'def'N'red')'def' ?'CR
  182. do i = 1 to 100
  183. pull ans
  184. arg
  185. if ans = 'Y' then call Pull 
  186.              else call rating
  187.  
  188. /**************************************************/
  189. /* Variables to hold count of doubles and triples */
  190. /* These get enabled when 15 doubles or 7 triples */
  191. /* have been reached. This might be pulled, prob- */
  192. /* ably put there to keep BBS users from playing  */
  193. /* too long.                                      */
  194. /**************************************************/
  195.  
  196. PTL:
  197. Tl = Tl + 1
  198. if Tl = 7 then call broken
  199. else call Pull
  200.  
  201. PDL:
  202. Dl = Dl + 1
  203. if Dl = 15 then call broken
  204. else call Pull
  205.  
  206. broken:
  207. say ' 'CR
  208. say whblk'The Casino Manager wants to see you!'def||CR
  209. say ' 'CR
  210. do i = 1 to 150
  211. say ital'It appears that he is not happy with you.'CR
  212. say 'You won too much money! Try again later.'def||CR
  213. say ' 'CR
  214. call rating
  215.  
  216. rating:
  217. if purse > 2000 then RATE = 'Mr. Trump! Your jet is waiting.'
  218. if purse > 1500 & purse <= 2000 then RATE = 'What city are you going to buy?'
  219. if purse > 1000 & purse <= 1500 then RATE = 'Your wallet is fat now!'
  220. if purse > 750 & purse <= 1000 then RATE = 'Pretty good.'
  221. if purse > 500 & purse <= 750 then RATE = 'Well, you did okay.'
  222. if purse > 250 & purse <= 500 then RATE = 'Er..stick to monopoly, eh?'
  223. if purse < 250 & purse >= 100 then RATE = 'You need help!'
  224. if purse < 100 then RATE = 'Hope you have enough for a cab home, sucker!'
  225. say ' '
  226. say 'You had 'dollarsign||red||purse||def' before you quit!'CR
  227. say 'Your rating is : 'ital RATE def||CR
  228. do i = 1 to 200
  229. end
  230. call death
  231.  
  232. loser:
  233. say ital'Well, you went broke, eh? Come back when you grow up!'def||CR
  234. do i = 1 to 150
  235. call death
  236.  
  237. BREAK_C:
  238. BREAK_E:
  239. death:
  240. say ' 'CR
  241. say 'You made' dollarsign||red purse def' today!'CR
  242. say 'Goodbye, 'ital||name||def'.'CR
  243. say ' 'CR
  244. CALL SETCLIP('BBS_winnings',purse)
  245. exit
  246. end
  247.